<?php
class Model_UserModel
{
    protected $_table;

    public function getTable()
    {
        if (null === $this->_table) {
            require_once APPLICATION_PATH . '/models/DbTable/User.php';
            $this->_table = new Model_DbTable_User;
        }
        return $this->_table;
    }

    public function fetchEntries()
    {
        return $this->getTable()->fetchAll('1')->toArray();
    }

    public function loginEntry($login, $pass)
    {
        $table 	= $this->getTable();
        $selectOb = $table->select()->where('login = ?', $login)->where('pass = ?', $pass);
		return $this->getTable()->fetchAll($selectOb)->toArray();
    }
	
}